<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性球</title>
    <style>
        body{
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content:center;
            align-items: center;
        }
        .bounceBall{
            width: 350px;
            height: 300px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction:column;
        }
        .ball{
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: red;
            animation: move 500ms infinite alternate;
        }
        @keyframes move {
            from{
                transform: translateY(0);
            }
            to{
                transform: translateY(-350px);
            }
           
        }
        .shadow{
            margin-top: -30px;
            width: 150px;
            height: 40px;
            background-color: black;
            border-radius: 100%;    
            animation: shadowMove 500ms infinite alternate;            
        }
        @keyframes shadowMove {
            from{
                opacity: .2;
                transform: scale(0.75);
            }
            to{
                opacity: .05;
                transform: scale(1);
            }
            
        }
    </style>
</head>
<body>
    <div class="bounceBall">
        <div class="ball" ></div>
        <div class="shadow"></div>
    </div>
    <div class="bounceBall">
        <div class="ball" style="background-color:cyan; animation-delay: 60ms;" ></div>
        <div class="shadow"></div>
    </div>
    <div class="bounceBall">
        <div class="ball" style="background-color:darkmagenta; animation-delay: 80ms;"></div>
        <div class="shadow"></div>
    </div>
</body>
</html>